package com.atguigu.object;

public class Student extends Person{
    //实例变量的属性私有化
    private int score;

    //无参构造
    public Student() {
    }

    //有参构造
    public Student(String name, int age, int score) {
        super(name, age);
        this.score = score;
    }

    //get/set
    public int getScore() {
        return score;
    }

    public void setScore(int score) {
        this.score = score;
    }

    //重写toString
    @Override
    public String toString() {
        return "Student{" +
                super.toString()+
                "score=" + score +
                "} "  ;
    }
}
